﻿using DataLayer.Entities;
using NHibernate.Criterion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataLayer.Implementations
{
    public class InvitationApplication : GeneralApplication<Invitation>
    {
        public Invitation GetByKey(string key)
        {
            List<ICriterion> conditions = new List<ICriterion>();
            conditions.Add(Restrictions.Eq("InvitationKey", key));

            return model.GetByCriterion<Invitation>(conditions).FirstOrDefault();
        }
    }
}
